class Person:
    # 初始化方法（构造函数），是在每次创建对象的时候被调用
    def __init__(self,name,age,city):
        self.name = name  # 实例的属性，每一个实例单独拥有
        self.age = age
        self.city = city


p1 = Person("张三",20,"上海")
p2 = Person("李四",21,"北京")
print(p1.name,p1.age,p1.city)
p1.city = "郑州"
print(p2.name,p2.age,p2.city)
print(p1.__dict__)
print(p2.__dict__)
